package com.groot.medical.servlet;

import java.io.IOException;
import java.util.Date;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.groot.common.controller.BaseServletController;



@WebServlet("/index.do")
public class IndexController extends BaseServletController {
	
	private static final long serialVersionUID = 1L;
	
	/**
	 * Log4j
	 */
	private static Logger LOGGER = LoggerFactory.getLogger(IndexController.class);

	public String execute(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		LOGGER.info("this is @WebServlet(\"/index.do\").execute()");
		response.getWriter().write("this is @WebServlet(\"/index.do\").execute()"+ new Date());
		return null;
	}
	
	/**
	 * 跳转错误提示页面
	 * @param request
	 * @param response
	 * @throws ServletException
	 * @throws IOException
	 */
	public String to404(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		return "WEB-INF/page/404.jsp";
	}
	
}
